package implicitCon

/**
  * Created by feng on 11/12/2018.
  */
object MyPreDef {


  implicit def girtOrdered(girl: Girl) = new Ordered[Girl]{
    override def compare(that: Girl): Int = {
      if (girl.faceValue == that.faceValue){
        girl.size-that.size
      }else{
        girl.faceValue-that.faceValue
      }
    }
  }


  implicit object girtOrdering extends Ordering[Girl]{
    override def compare(x: Girl, y: Girl): Int = {
      if (x.faceValue == y.faceValue){
        x.size-y.size
      }else{
        x.faceValue-y.faceValue
      }
    }
  }

}
